import java.io.*;

public class RecursionFibonacci
{
public static void main(String[] args)
{
//print first 20 numbers in fibonacci seq
fibonacci_sequence(0,20);
}

private static void fibonacci_sequence(int n, int max)
{
    	if(n == max)
	    return;

	System.out.println("" + fibonacci(n));
	fibonacci_sequence(n + 1, max);
}

private static int fibonacci(int n)
{
    if (n == 0 || n == 1)
	return n;
    return fibonacci(n - 1) + fibonacci(n - 2);
}
}
